WPF and Silverlight Edition Basic Library > LayoutPanels > Layout Panels Quick Starts > UniformGrid Quick Start |
The following quick start guide is intended to get you up and running with UniformGrid for Silverlight. In this quick start, you'll create a new project in Visual Studio, add a C1UniformGrid to your application, set the Columns and FirstColumn properties, and then run the application.
To set up your project, complete the following steps:
New Project Dialog
- WPF: C1.WPF.4.dll
- Silverlight: C1.Silverlight.5.dll
In the next step, you'll add a UniformGrid control.
XAML Copy Code <Border Background="#FF005B84" > <TextBlock Text="0" /> </Border> <Border Background="#FF008B9C" > <TextBlock Text="1" /> </Border> <Border Background="#FF00ADD6" > <TextBlock Text="2" /> </Border> <Border Background="#FF497331" > <TextBlock Text="3" /> </Border> <Border Background="#FF0094D6" > <TextBlock Text="4" /> </Border> <Border Background="#FF9DCFC3" > <TextBlock Text="5" /> </Border> <Border Background="#FFA5DDFE" > <TextBlock Text="6" /> </Border> <Border Background="#FFE0EEEF" > <TextBlock Text="7" /> </Border> <Border Background="CornflowerBlue" > <TextBlock Text="8" /> </Border> <Border Background="LightYellow" > <TextBlock Text="9" /> </Border>
If you run the application at this point, it looks like the following image:
In this step, we'll set the set the Columns, FirstColumn, and Width properties. The Columns will set the number of columns in the grid, and the FirstColumn property will determine how many empty cells will appear in the first row.
XAML Copy Code <c1:C1UniformGrid Columns="3" FirstColumn="2" Width="300">
There will be two empty cells in the first row of the grid, as specified with the FirstColumn property.
In the next step, you will run the application to see the results.
Now you're ready to run the application. From the Debug menu, select Start Debugging. Your application will look similar to the following:
Notice the two empty cells in the first row.
Congratulations! You have successfully completed the UniformGrid for Silverlight quick start.